<?php 
namespace app\index\service;

class Encrypt
{
    protected $secretKey = "abc123admin"; // 密钥
    protected $cipher = "aes-256-cbc"; // 加密算法
    
    public function encrypt($data)
    {
        return openssl_encrypt($data, $this->cipher, $this->secretKey, 0, '1234567890123456');
    }
    
    public function decrypt($encryptedData)
    {
        return openssl_decrypt($encryptedData, $this->cipher, $this->secretKey, 0, '1234567890123456');
    }
}